
import org.antlr.v4.runtime.CharStream;
import org.antlr.v4.runtime.CommonTokenStream;
import org.antlr.v4.runtime.tree.ParseTree;
import org.antlr.v4.runtime.tree.ParseTreeWalker;

import java.io.IOException;

public class main {

    public static void main(String[] args) throws IOException {

        PLCLoader loader = new PLCLoader();
        CharStream charStream = loader.LoadPlcStreamFromFileName();

        PLCLexer lexer = new PLCLexer();
        CommonTokenStream commonTokenStream = lexer.OutLexTokenStream(charStream);

        PLCParser paser = new PLCParser();
        ParseTree AST = paser.OutParserAst(commonTokenStream);


        ParseTreeWalker parseTreeWalker = new ParseTreeWalker();//遍历器

        //parseTreeWalker.walk(listener, AST);//遍历器加载监听器对树进行遍历

        PLCVisitor plcVisitor = new PLCVisitor();

        //访问器加载AST开始访问
        plcVisitor.visit(AST);

        //


    }


}
